interface Shape{
    void draw();
}

class Rect implements Shape{
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}

class Flower implements Shape{
    @Override
    public void draw() {
        System.out.println("❀");
    }
}

public class Test3 {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        Shape shape1 = new Rect();
        Shape shape2 = new Flower();

        drawMap(shape1);
        drawMap(shape2);

        System.out.println("================");

        Shape[] shapes = {new Rect(),new Flower(),new Rect()};

        for (Shape shape : shapes) {
            shape.draw();
        }

    }
}
